{{ define "main" }}
  <article class="post">
    <header>
      <div class="title">
        {{ if $.Scratch.Get "h1" }}
          <h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
          {{ $.Scratch.Set "h1" false }}
        {{ else }}
          <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
        {{ end }}
        {{ with .Description }}<p>{{ . }}</p>{{ end }}
      </div>
    </header>
      <div id="content">
        {{ .Content }}
        <div class="contact-container">
          {{ if .Params.netlify }}
            <form name="contact" action="thank-you" netlify center width="300px">
          {{ else }}
            <form id="contact" action="//{{ .Params.emailService }}" method="post" center width="300px">
          {{ end }}
          <h4>{{ i18n "repliestext" .Params.contactanswertime }}</h4>
          <fieldset>
            <input placeholder="{{ with .Params.contactname }}{{ . }}{{ else }}Name{{ end }}" type="text" name="name" tabindex="1" required autofocus>
          </fieldset>
          <fieldset>
            <input placeholder="{{ with .Params.contactemail }}{{ . }}{{ else }}Email{{ end }}" type="email" name="_replyto" tabindex="2" required>
          </fieldset>
          <fieldset>
            <input placeholder="{{ with .Params.contactsubject }}{{ . }}{{ else }}Subject{{ end }}" type="text" name="_subject" tabindex="3" required>
          </fieldset>
          <fieldset>
            <textarea placeholder="{{ with .Params.contactmessage }}{{ . }}{{ else }}Message{{ end }}" name="message" tabindex="4" required></textarea>
          </fieldset>
          <fieldset>
            <input type="hidden" name="_language" value="{{ .Params.contactlang }}">
          </fieldset>
          <fieldset>
            <button name="submit" class="button" type="submit" id="contact-submit" tabindex="5">{{ i18n "submit" }}</button>
          </fieldset>
        </form>
      </div>
    </div>
  </article>
{{ end }}
